# Copyright (c) 1999 Apple Computer, Inc.  All rights reserved.
#  

TARGET = ./ArRtspTool
C++ = g++
CC = gcc
INCLUDE_FLAG = -include
INCPATH = -I./ -I./include
LIBPATH = -lpthread -lz -L./lib_linux -lRtspClient -lRtcLite
CCFLAGS += -Wall -D_GNU_SOURCE -DNDEBUG -O2 -DPOSIX -DARRTC_EXPORT -DNO_DL -DFEATURE_ENABLE_SSL -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
LFLAGS	= -w -lrt -ldl 

# EACH DIRECTORY WITH HEADERS MUST BE APPENDED IN THIS MANNER TO THE CCFLAGS

C++FLAGS = $(CCFLAGS)

CFILES = \

CPPFILES = \
    ./config.cpp \
    ./main.cpp \
	./PullToRtc1xN.cpp \
	./PullToRtcNxN.cpp \
	./XUtil.cpp

		
CCFILES = \
		

all: $(TARGET)

$(TARGET): $(CFILES:.c=.o) $(CCFILES:.cc=.o) $(CPPFILES:.cpp=.o)
	$(CXX) $(LFLAGS) $(CFILES:.c=.o) $(CCFILES:.cc=.o) $(CPPFILES:.cpp=.o) -o $(TARGET) $(LIBPATH)

install: 
#	install -m 664 ArRtspTool ../out/Linux
	rm -rf ./lib_run
	mkdir ./lib_run
	cp ./lib_linux/* ./lib_run/

clean:
	rm -f $(TARGET) $(CFILES:.c=.o) $(CCFILES:.cc=.o) $(CPPFILES:.cpp=.o)

.SUFFIXES: .cpp .cc .c .o

.cpp.o:
	$(C++) -c -o $*.o $(DEFINES) -std=c++11 $(C++FLAGS) $*.cpp $(INCPATH)
	
.cc.o:
	$(C++) -c -o $*.o $(DEFINES) -std=c++11 $(C++FLAGS) $*.cc $(INCPATH)

.c.o:
	$(CC) -c -o $*.o $(DEFINES) -std=c99 $(CCFLAGS) $*.c $(INCPATH)

